package com.tanhua.manage.controller;

import com.tanhua.manage.service.AnalysisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AnalysisController {
    @Autowired
    private AnalysisService analysisService;

    /**
     * 接口名称：概要统计信息
     * 接口路径：GET/dashboard/summary
     */
    @GetMapping("dashboard/summary")
    public ResponseEntity<Object> summary() {
        return analysisService.summary();
    }

    /**
     * 接口名称：新增、活跃用户、次日留存率
     * 接口路径：GET/dashboard/users
     */
    @GetMapping("dashboard/users")
    public ResponseEntity<Object> queryAnalysisUsers(Long sd, Long ed, Integer type) {
        return analysisService.queryAnalysisUsers(sd, ed, type);
    }
}